package com.bk.mapper.cardInfo;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import com.bk.entity.CardInfo;
import com.bk.vo.UserCardInfoVo;

@Component/**参与卡信息的创建*/
public interface CardInfoMapper {

	/** 创建卡号  uid用户身份证号*/
	public int createAccountInfo(@Param("cardInfo") CardInfo cardInfo,@Param("uid") String uid);

	/**给生成卡号赋默认值*/
	public int createOriginBalance(@Param("cardId") String cardId, @Param("balance") String balance);
	
	/**卡号是否存在*/
	public CardInfo isExistCardInfo(@Param("uid") String uid, @Param("cardId") String cardId);

	/**根据账户和密码判断是否存在该账户*/
	public CardInfo isExistCardByAccountIdAndPass(@Param("cardId") String accountId,@Param("cardPassword") String cardPassword);

	/**通过账户名,账户,密码查询该账户是否存在*/
	public UserCardInfoVo isExistCardByAccountIdAndPassAndName(@Param("cardId") String cardId,@Param("cardPassword") String cardPassword,@Param("uname") String uname);

	/**通过账户名,账户查询该账户是否存在*/
	public CardInfo isExistCardByAccountIdAndUname(@Param("recevieAccount") String recevieAccount,@Param("recevieAccountName")  String recevieAccountName);

	/**通过账号查询该账户是否存在*/
	public CardInfo isExistCardByAccountId(String cardId);

	/**设置账户冻结还是解冻*/
	public int blockOrUnBlockAccount(@Param("block") int block,@Param("cardId") String cardId);

	/**通过账户 身份证  账户名来判断是否存在*/
	public UserCardInfoVo isExistCardByAccountIdAndUidAndName(@Param("cardId") String cardId,@Param("uid") String uid,@Param("uname") String uname,@Param("utelephone") String utelephone);

	/**销户*/
	public Integer closeAccount(@Param("cardId") String cardId,@Param("uname") String uname,@Param("uid") String uid);

	/**根据卡号和身份证删除卡信息*/
	public int deleteCardInfoByCardId(@Param("cardId") String cardId,@Param("uid") String uid);
	
	/**根据身份证查询该账户创建的卡号*/
	public List<CardInfo> getAccountId(@Param("uId") String uId);
}
